@ GNU AS assembler header file for Scrollbar
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:50:30 2012
@ Tom Hughes, tom@compton.nu, 14 Mar 1999

@ OSLib---efficient, type-safe, transparent, extensible,
@ register-safe API coverage of RISC OS
@ 
@ Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
@ 
@ Licence:
@ 
@    OSLib is free software; you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation; either version 1, or (at your option)
@ any later version - and this with the following clarification and
@ special exception:
@ 
@    Linking this library statically or dynamically with other modules
@ is making a combined work based on this library. Thus, the terms
@ and conditions of the GNU General Public License cover the whole
@ combination.
@ 
@    As a special exception, the copyright holders of this library
@ give you permission to link this library with independent modules
@ to produce an executable, regardless of the license terms of these
@ independent modules, and to copy and distribute the resulting
@ executable under terms of your choice, provided that you also meet,
@ for each linked independent module, the terms and conditions of the
@ license of that module. An independent module is a module which is
@ not derived from or based on this library. If you modify this
@ library, you may extend this exception to your version of the library,
@ but you are not obliged to do so. If you do not wish to do so, delete
@ this exception statement from your version.
@ 
@    OSLib is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@ GNU General Public License for more details.
@ 
@    You should have received a copy of the GNU General Public License
@ along with this programme; if not, write to the Free Software
@ Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef Scrollbar_Hdr
#  define Scrollbar_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

#  ifndef Get_Toolbox
#    define Get_Toolbox
#    include "oslib/Toolbox.Hdr"
#  endif

#  ifndef Get_Gadget
#    define Get_Gadget
#    include "oslib/Gadget.Hdr"
#  endif

@Symbols for constants
#  define Class_Scrollbar 0x401b
#  define Action_ScrollbarPositionChanged 0x140183
#  define Scrollbar_HasVerticalScrollbar 0x1
#  define Scrollbar_HasHorizontalScrollbar 0x2
#  define Scrollbar_BoundsLower 0x1
#  define Scrollbar_BoundsUpper 0x2
#  define Scrollbar_BoundsVisibleLength 0x4
#  define Scrollbar_IncrementsLine 0x1
#  define Scrollbar_IncrementsPage 0x2

@Symbols for structure offsets and sizes
        .struct 0
Scrollbar_Gadget_type          : .skip   Int
Scrollbar_Gadget_event         : .skip   Int
Scrollbar_Gadget_lower_bound   : .skip   Int
Scrollbar_Gadget_upper_bound   : .skip   Int
Scrollbar_Gadget_value         : .skip   Int
Scrollbar_Gadget_visible_length: .skip   Int
Scrollbar_Gadget_line_increment: .skip   Int
Scrollbar_Gadget_page_increment: .skip   Int
Scrollbar_Gadget               : 

        .struct 0
        Gadget_Object_MEMBERS Scrollbar_Object
Scrollbar_Object_type          : .skip   Int
Scrollbar_Object_event         : .skip   Int
Scrollbar_Object_lower_bound   : .skip   Int
Scrollbar_Object_upper_bound   : .skip   Int
Scrollbar_Object_value         : .skip   Int
Scrollbar_Object_visible_length: .skip   Int
Scrollbar_Object_line_increment: .skip   Int
Scrollbar_Object_page_increment: .skip   Int
Scrollbar_Object               : 

        .struct 0
Scrollbar_PositionChanged_new_position: .skip   Bits
Scrollbar_PositionChanged_direction: .skip   Int
Scrollbar_PositionChanged      : 

        .struct 0
Scrollbar_ActionPositionChanged_new_position: .skip   Bits
Scrollbar_ActionPositionChanged_direction: .skip   Int
Scrollbar_ActionPositionChanged: 

        .struct 0
        Toolbox_ActionHeader_MEMBERS Scrollbar_ActionPositionChangedBlock
Scrollbar_ActionPositionChangedBlock_new_position: .skip   Bits
Scrollbar_ActionPositionChangedBlock_direction: .skip   Int
Scrollbar_ActionPositionChangedBlock: 

        .struct 0
        .skip   Bits
Scrollbar_State                : 

        .struct 0
        .skip   Bits
Scrollbar_BoundsFlags          : 

        .struct 0
        .skip   Bits
Scrollbar_IncrementsFlags      : 


@Symbols for SWI's and SWI reason codes
#  define Scrollbar_GetState 0x401b
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401B
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 = state (Scrollbar_State)

#  define Scrollbar_SetState 0x401c
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401C
   @  R3 = scroll_bar (Toolbox_C)
   @  R4 = state (Scrollbar_State)

#  define Scrollbar_SetBounds 0x401d
   @Entry
   @  R0 = flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401D
   @  R3 = scroll_bar (Toolbox_C)
   @  R4 = lower_bound (Int)
   @  R5 = upper_bound (Int)
   @  R6 = visible_length (Int)

#  define Scrollbar_SetLowerBound 0x1
   @Entry
   @  R0 = &1 :OR: flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401D
   @  R3 = scroll_bar (Toolbox_C)
   @  R4 = lower_bound (Int)

#  define Scrollbar_SetUpperBound 0x2
   @Entry
   @  R0 = &2 :OR: flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401D
   @  R3 = scroll_bar (Toolbox_C)
   @  R5 = upper_bound (Int)

#  define Scrollbar_SetVisibleLength 0x4
   @Entry
   @  R0 = &4 :OR: flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401D
   @  R3 = scroll_bar (Toolbox_C)
   @  R6 = visible_length (Int)

#  define Scrollbar_GetBounds 0x401e
   @Entry
   @  R0 = flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401E
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 = lower_bound (Int)
   @  R1 = upper_bound (Int)
   @  R2 = visible_length (Int)

#  define Scrollbar_GetLowerBound 0x1
   @Entry
   @  R0 = &1 :OR: flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401E
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 = lower_bound (Int)
   @  R1 corrupted
   @  R2 corrupted

#  define Scrollbar_GetUpperBound 0x2
   @Entry
   @  R0 = &2 :OR: flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401E
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 corrupted
   @  R1 = upper_bound (Int)
   @  R2 corrupted

#  define Scrollbar_GetVisibleLength 0x4
   @Entry
   @  R0 = &4 :OR: flags (Scrollbar_BoundsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &401E
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 corrupted
   @  R1 corrupted
   @  R2 = visible_length (Int)

#  define Scrollbar_SetValue 0x401f
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &401F
   @  R3 = scroll_bar (Toolbox_C)
   @  R4 = value (Int)

#  define Scrollbar_GetValue 0x4020
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4020
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 = value (Int)

#  define Scrollbar_SetIncrements 0x4021
   @Entry
   @  R0 = flags (Scrollbar_IncrementsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &4021
   @  R3 = scroll_bar (Toolbox_C)
   @  R4 = line_increment (Int)
   @  R5 = page_increment (Int)

#  define Scrollbar_SetLineIncrement 0x1
   @Entry
   @  R0 = &1 :OR: flags (Scrollbar_IncrementsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &4021
   @  R3 = scroll_bar (Toolbox_C)
   @  R4 = line_increment (Int)

#  define Scrollbar_SetPageIncrement 0x2
   @Entry
   @  R0 = &2 :OR: flags (Scrollbar_IncrementsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &4021
   @  R3 = scroll_bar (Toolbox_C)
   @  R5 = page_increment (Int)

#  define Scrollbar_GetIncrements 0x4022
   @Entry
   @  R0 = flags (Scrollbar_IncrementsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &4022
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 = line_increment (Int)
   @  R1 = page_increment (Int)

#  define Scrollbar_GetLineIncrement 0x1
   @Entry
   @  R0 = &1 :OR: flags (Scrollbar_IncrementsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &4022
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 = line_increment (Int)
   @  R1 corrupted

#  define Scrollbar_GetPageIncrement 0x2
   @Entry
   @  R0 = &2 :OR: flags (Scrollbar_IncrementsFlags)
   @  R1 = window (Toolbox_O)
   @  R2 = &4022
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 corrupted
   @  R1 = page_increment (Int)

#  define Scrollbar_SetEvent 0x4023
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4023
   @  R3 = scroll_bar (Toolbox_C)
   @  R4 = event_code (Bits)

#  define Scrollbar_GetEvent 0x4024
   @Entry
   @  R0 = flags (Bits)
   @  R1 = window (Toolbox_O)
   @  R2 = &4024
   @  R3 = scroll_bar (Toolbox_C)
   @Exit
   @  R0 = event_code (Bits)

#endif
